{include file='header'/}
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <form class="layui-form layuimini-form" action="javascript:;" method="post" onsubmit="return dosub(this)">

            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span class="we-red">*</span>分类名称
                </label>
                <div class="layui-input-block">
                    <input type="text" id="name" name="name" value="" lay-verify="required" autocomplete="off" class="layui-input" >
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-sm" lay-submit="">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">重置</button>
                </div>
            </div>

        </form>
    </div>
</div>
{include file='footer'/}
<script>
  layui.use(['form', 'jquery', 'upload'], function () {
    let form = layui.form, $ = layui.jquery, upload = layui.upload;
    form.render();
    upload.render({
      elem: '#test1'
      , url: "{:__url('upload/index',['save_path'=>'images'])}"
      , done: function (res) {
        if (res.code === 1) {
          $("#image").val(res.url);
        }
      }
    })
    window.dosub = function (obj) {
      HuiDoSub($(obj).serialize(), "{:__url('cat_add')}");
    }
  });

</script>
</body>
</html>